﻿using System;
using System.Windows.Forms;

namespace PokerPlanning2
{
    public partial class MainForm : Form
    {
        public MainForm( )
        {
            InitializeComponent();
            panel1.Visible = false;
        }

        private void panel1_Click(object sender, EventArgs e)
        {
            ShowOrHideTheNumber();
        }

        private void ShowOrHideTheNumber()
        {
            if( displayLabel.Visible )
            {
                panel1.Visible = false;
                return;
            }
            displayLabel.Visible = true;
            
        }

        private void Button_Click(object sender, EventArgs e)
        {
            displayLabel.Text = ((Control)sender).Tag.ToString();
            displayLabel.Visible = false;
            panel1.Visible = true;
            panel1.BringToFront();
        }

        private void MainForm_KeyDown(object sender, KeyEventArgs e)
        {
            if( (e.KeyCode == System.Windows.Forms.Keys.Enter) )
            {
                // Enter
                if (panel1.Visible)
                {
                    e.Handled = true;
                    ShowOrHideTheNumber();
                }
            }

        }
    }
}